<!DOCTYPE html>
<?php
require 'common/common.php';
?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            /*图片地址 不重复 水平位置居中 垂直位置居中*/
            background: url("1.jpg") no-repeat center center;
            height: 100%;
            width: 100%;
            /*把背景图片放大到适合元素容器的尺寸，图片比例不变*/
            background-size:cover;
            backdrop-filter: blur(4px);
        }
        ::placeholder {
        color: #C7EDCC; 
      }

            input:focus {
                outline:none;
            }
            input{
                border:none;
                outline:none;
            }
            textarea{
                border:none;
                outline:none; 
                font-weight:700;
            }
            textarea:focus {
                outline:none;
            }
        .fourth-contnet{
            width: 832px;
                margin:100px auto;
            }
            .fourth-contnet input{
                height: 30px !important;
                line-height:30px;
            }
            .fourth-contnet input, 
            .fourth-contnet textarea{
                width: 800px;
                height: 500px; 
                padding: 0px 15px; 
                margin-bottom: 18px; 
                border: 1px #33d182 solid;
                border-radius: 3px;
                font-size: 14px; 
                color:#BC1717;
                line-height: 30px; 
                background: rgba(51, 209, 130, 0.1); 
                resize:none;
            }
            .quit{
                display: block;
                width: 806px !important;
            }
            .fourth-contnet input[type='submit'],
            .quit{
                
                text-decoration:none;
                text-align:center;
                width: 832px;
                padding: 0px 15px; 
                margin-bottom: 18px; 
                cursor: pointer; 
                background: #33d182;
                font-size: 16px;
                letter-spacing: 2px; 
                border: none;
                color: #fff;
                line-height: 30px;
                margin-right: 15px;
            }
            
    </style>
</head>
<body>
    <?php
        $uid = $_GET["id"];
        $sql = "select * from essay where essay_id=$uid";
    ?>
            <div class="fourth-contnet">
                    <form action="admin_essay_updata.php?id=<?php echo $uid ?>" enctype="multipart/form-data" method="POST">
                        <input type="text"  placeholder="<?php echo getDataSetBySQL($sql)[0]["essay_name"] ?>" /> </br>
                        <textarea  name="content" placeholder="<?php echo getDataSetBySQL($sql)[0]["detail"] ?>" maxlength="300" minlength="10"></textarea>
                        <input type="submit" value="提交" name="submit"><br>
                        <a href="admin.php" class="quit"  style="border-radius: 3px;">取消</a>
                    </form>
            </div>
            <?php
                    if(isset($_POST["submit"])){
                        $title = $_POST["title"];
                        $content = $_POST["content"];
                        $sql = "UPDATE essay SET essay_name='$title', detail = '$content' where essay_id='$uid'";
                        getResultBySQL($sql);
                        echo "<script>alert('修改成功');window.location.href='admin.php'</script>";
                    }
                
            ?>
</body>
</html>